Setting culling

In Kanzi render passes you can optimize the performance of meshes in your applications by setting the culling properties.

Setting the culling properties

To set the culling properties:

  1. In the Library select Composing > Composers and the render pass you are using, or create a new Render Pass.
    Note that you can set the culling only for the render passes you create, and not for the default render pass.
  2. In the Properties in the Culling properties set:
    • Enable the Frustum Culling property so that the mesh nodes, whose bounding boxes are not within the viewing frustum of the active camera, are not rendered.
    • Cull Mode to Back so that polygons whose normals point away from the active camera are not rendered.

Controlling culling

You can control culling for individual meshes. This is useful when, for example, a vertex shader radically modifies the geometry of nodes, such as vertex skinned nodes.

To control culling:

  1. In the Project select the node for which you want to control culling.
  2. In the Properties click , and add Frustum Cull Margin property.
  3. Adjust the cull margin of the node.
    To see if your culling setting works as you intended it to work, in the Preview click , use the drop-down menu to select the Performance HUD, and move the camera away from the node for which you want to control culling. When culling does not occur anymore for the node, Batch count value drops.

See also

Reducing the number of rendered vertices

Setting the correct size of vertex cache

Loading resources in parallel

Measuring the performance of your application

Best practices